﻿@{
    ViewBag.Title = "重置密码";
    ViewBag.SettingTitle = "重置密码 <small class='muted'>( <span class='text-error'>*</span> 为必填项)</small>";
    Layout = "~/Views/Shared/_UserLayout.cshtml";
}

<div class="well well-small" style="width: 95%; background: none; border: none; padding-left: 0;">
    @{
        Hetang.Models.Interface.IDatabaseRepository _dr = new Hetang.Models.Repository.DatabaseRepository();
        string email = _dr.GetEmail();
        int index = email.IndexOf('@') - 1;
        string endStr = email.Substring(index);
        email = email[0] + "********" + endStr;
    }

    @if (!string.IsNullOrEmpty(Request["status"]))
    {
        if (Request["status"].Equals("sent"))
        {
        <div class="alert alert-success">(′∀`=) 改密码那封信已经寄到 @email 啦，请登录信箱查收，再按提示进行操作就可以了！</div>
        }
        else if (Request["status"].Equals("unsent"))
        {
        <div class="alert alert-error">(。・д・。) 唉呀！我刚才忙不过来了，那封改密码的信我还没有寄去你的信箱，你再试一次好吗？！@Html.ActionLink("我要再改一次密码", "resetpwd", "account", new { area = "user" }, null)</div>
        }
    }
    else if (!string.IsNullOrEmpty(Request["exist"]))
    {
        if (Request["exist"].Equals("true"))
        {
        <div class="alert alert-error">(。・д・。) 没有收到刚才的邮件吗？系统限制，@(((Hetang.Models.MailServer.MailServerConfig)System.Configuration.ConfigurationManager.GetSection("mailServerGroup"))[0].ExpiresMinute)分钟之后再可发送密码重置邮件！</div>
        }
    }
    else
    {
        <h5>点击下面的“发送”按钮，我们将会发送一封包含了密码重置链接的邮件到你的邮箱，你只需要进入邮箱点击邮件里面的链接按提示操作即可！</h5>
        <br />
        <form method="post">
            邮件将会发送到以下邮箱：@email
            <input type="submit" id="btn_send" class="btn btn-info" style="margin-left: 10px" value="发送" />
        </form>
        <script type="text/javascript">
            $("#btn_send").click(function () {
                $(this).val("发送中。。。").addClass("disabled");
            });
        </script>
    }
</div>
